/*
  1、定义枚举类，枚举出日志等级
  2、提供转换接口：将枚举转换为对应字符串
*/
#ifndef __M_LEVEL_H__
#define __M_LEVEL_H__

namespace Mylog
{
    class Loglevel
    {
        public:
            enum class value
            {
                UNKNOW = 0,
                DEBUG,
                INFO,
                WARN,
                ERROR,
                FATAL,
                OFF
            };
            static const char *toString(Loglevel::value level)
            {
                switch(level)
                {
                    case Loglevel::value::DEBUG: return "DEBUG";
                    case Loglevel::value::INFO: return "INFO";
                    case Loglevel::value::WARN: return "WARN";
                    case Loglevel::value::ERROR: return "ERROR";
                    case Loglevel::value::FATAL: return "FATAL";
                    case Loglevel::value::OFF: return "OFF";
                }
                return "UNKNOW";
            }
    };
}
#endif